package com.lujianfei.filesend.db.model

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(
    tableName = "transfer_file",
    indices = [Index(value = ["md5"], unique = true)]
)
data class TransferFile(
    /**
     * ID
     */
    @PrimaryKey(autoGenerate = true)
    val _id: Int = 0,
    /**
     * 文件 唯一编码
     */
    @ColumnInfo(name = "md5")
    var md5: String = "",
    /**
     * 当前进度
     */
    @ColumnInfo(name = "progress")
    var progress: Long = 0,
    /**
     * 总进度
     */
    @ColumnInfo(name = "max")
    var max: Long = 0,
) {
    @Ignore
    constructor():this(_id = 0, md5="", progress = 0, max = 0)
}
